﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DAL;
using MDL;

namespace BLL
{
    public class BLL_Tables
    {
        /// <summary>
        /// 根据房间ID获取该房间所有餐桌信息
        /// </summary>
        /// <param name="Rtid">房间ID</param>
        /// <returns>该房间的所有餐桌信息</returns>
        public static List<Tables> SelectTables(int Rtid)
        {
            return DAL_Tables.SelectTables(Rtid);
        }
        /// <summary>
        /// 根据餐桌ID修改餐桌当前状态
        /// </summary>
        /// <param name="TableId">餐桌ID</param>
        /// <param name="TableState">目标状态</param>
        /// <returns>受影响的行数</returns>
        public static int UpdateTableState(int TableId, int TableState)
        {
            return DAL_Tables.UpdateTableState(TableId, TableState);
        }
        /// <summary>
        /// 根据餐桌状态显示房间的餐桌
        /// </summary>
        /// <param name="TableState">根据餐桌状态</param>
        /// <returns>需要显示的餐桌ID</returns>
        public static List<Tables> SelectTable(int RTID,int TableState)
        {
            return DAL_Tables.SelectTable(RTID,TableState);
        }
        /// <summary>
        /// 根据餐桌ID和状态查找数据
        /// </summary>
        /// <param name="tb"></param>
        /// <returns></returns>
        public static List<Tables> select_Tables_Data(Tables tb)
        {
            return DAL.DAL_Tables.select_Tables_Data(tb);
        }
        /// <summary>
        /// 根据餐桌ID和状态查找所有数据
        /// </summary>
        /// <param name="tb"></param>
        /// <returns></returns>
        public static List<Tables> select_Tables(Tables tb)
        {
            return DAL.DAL_Tables.select_Tables(tb);
        }
        /// <summary>
         /// 统计餐桌状态数量
         /// </summary>
         /// <param name="tablestate">根据的状态</param>
         /// <returns>每个状态的数量</returns>
        public static object SelectTableState(int tablestate)
        {
            return DAL_Tables.SelectTableState(tablestate);
        }
        /// <summary>
         /// 根据餐桌名字查找是否可用
         /// </summary>
         /// <param name="tb"></param>
         /// <returns></returns>
        public static List<Tables> select_Tables_state(Tables tb)
        {
            return DAL_Tables.select_Tables_state(tb);
        }
        /// <summary>
         /// 查询消费餐桌人数
         /// </summary>
         /// <param name="ID">餐桌ID</param>
         /// <param name="Zdh">账单编号</param>
         /// <returns>返回人数</returns>
        public static object SelectTablesNum(int ID, string Zdh)
        {
            return DAL_Tables.SelectTablesNum(ID, Zdh);
        }
        /// <summary>
        /// 查询餐台信息
        /// </summary>
        /// <param name="RID">根据房间类型ID</param>
        /// <returns>餐台信息</returns>
        public static List<Tables> SelectTableInfo(int RID)
        {
            return DAL_Tables.SelectTableInfo(RID);
        }
        /// <summary>
        /// 下拉绑定房间区域
        /// </summary>
        /// <returns>房间区域</returns>
        public static List<Tables> SelectTableQuYu()
        {
            return DAL_Tables.SelectTableQuYu();
        }
        /// <summary>
        /// 单个增加餐台
        /// </summary>
        /// <param name="name">餐台名称</param>
        /// <param name="id">餐台所属房间类型</param>
        /// <param name="qy">所在区域</param>
        /// <param name="state">餐台状态</param>
        /// <returns>受影响的行数</returns>
        public static int AddTable(string name, int id, string qy, int state)
        {
            return DAL_Tables.AddTable(name, id, qy, state);
        }
        /// <summary>
        /// 删除餐台
        /// </summary>
        /// <param name="name">根据餐台名称</param>
        /// <returns>受影响的行数</returns>
        public static int DeleteTable(string name)
        {
            return DAL_Tables.DeleteTable(name);
        }
        /// <summary>
        /// 修改餐台信息
        /// </summary>
        /// <param name="name">餐台名称</param>
        /// <param name="id">所属房间类型</param>
        /// <param name="qy">所在区域</param>
        /// <param name="name1">根据餐台名称</param>
        /// <returns>受影响的行数</returns>
        public static int UpdateTable(string name, int id, string qy, string name1)
        {
            return DAL_Tables.UpdateTable(name, id, qy, name1);
        }
        /// <summary>
        /// 根据餐台ID查询是否可预定的餐台
        /// </summary>
        /// <param name="state">餐台状态</param>
        /// <returns>是否可预定的餐台</returns>
        public static List<Tables> GetTablesState(int state)
        {
            return DAL_Tables.GetTablesState(state);
        }
        /// <summary>
        /// 根据餐桌名称修改餐桌当前状态
        /// </summary>
        /// <param name="TableId">餐桌名称</param>
        /// <param name="TableState">目标状态</param>
        /// <returns>受影响的行数</returns>
        public static int UpdateTableState(string name, int State)
        {
            return DAL_Tables.UpdateTableState(name, State);
        }
    }
}
